package com.tg.data.http.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

public  class DriveRecord implements Parcelable {
    private long id;
    private String start_time_unix;
    private String end_time_unix;
    private String start_addr;
    private String end_addr;
    private int total_time;
    private double max_speed;
    private double distance;
    private double aver_speed;
    private String uuid;


    protected DriveRecord(Parcel in) {
        id = in.readLong();
        start_time_unix = in.readString();
        end_time_unix = in.readString();
        start_addr = in.readString();
        end_addr = in.readString();
        total_time = in.readInt();
        max_speed = in.readDouble();
        distance = in.readDouble();
        aver_speed = in.readDouble();
        uuid = in.readString();
        gps_set = in.createTypedArrayList(DriveRecordItem.CREATOR);
        start_lat = in.readDouble();
        start_lng = in.readDouble();
        end_lat = in.readDouble();
        end_lng = in.readDouble();
        image_path = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(id);
        dest.writeString(start_time_unix);
        dest.writeString(end_time_unix);
        dest.writeString(start_addr);
        dest.writeString(end_addr);
        dest.writeInt(total_time);
        dest.writeDouble(max_speed);
        dest.writeDouble(distance);
        dest.writeDouble(aver_speed);
        dest.writeString(uuid);
        dest.writeTypedList(gps_set);
        dest.writeDouble(start_lat);
        dest.writeDouble(start_lng);
        dest.writeDouble(end_lat);
        dest.writeDouble(end_lng);
        dest.writeString(image_path);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<DriveRecord> CREATOR = new Creator<DriveRecord>() {
        @Override
        public DriveRecord createFromParcel(Parcel in) {
            return new DriveRecord(in);
        }

        @Override
        public DriveRecord[] newArray(int size) {
            return new DriveRecord[size];
        }
    };

    public List<DriveRecordItem> getGps_set() {
        return gps_set;
    }

    private List<DriveRecordItem> gps_set;

    public double getStart_lat() {
        return start_lat;
    }

    public void setStart_lat(double start_lat) {
        this.start_lat = start_lat;
    }

    public double getStart_lng() {
        return start_lng;
    }

    public void setStart_lng(double start_lng) {
        this.start_lng = start_lng;
    }

    public double getEnd_lat() {
        return end_lat;
    }

    public void setEnd_lat(double end_lat) {
        this.end_lat = end_lat;
    }

    public double getEnd_lng() {
        return end_lng;
    }

    public void setEnd_lng(double end_lng) {
        this.end_lng = end_lng;
    }

    private double start_lat;
    private double start_lng;
    private double end_lat;
    private double end_lng;

    public String getImage_path() {
        return image_path;
    }

    public void setImage_path(String image_path) {
        this.image_path = image_path;
    }

    private String image_path;


    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getStart_time_unix() {
        return start_time_unix;
    }

    public void setStart_time_unix(String start_time_unix) {
        this.start_time_unix = start_time_unix;
    }

    public String getEnd_time_unix() {
        return end_time_unix;
    }

    public void setEnd_time_unix(String end_time_unix) {
        this.end_time_unix = end_time_unix;
    }

    public String getStart_addr() {
        return start_addr;
    }

    public void setStart_addr(String start_addr) {
        this.start_addr = start_addr;
    }

    public String getEnd_addr() {
        return end_addr;
    }

    public void setEnd_addr(String end_addr) {
        this.end_addr = end_addr;
    }

    public int getTotal_time() {
        return total_time;
    }

    public void setTotal_time(int total_time) {
        this.total_time = total_time;
    }

    public double getMax_speed() {
        return max_speed;
    }

    public void setMax_speed(double max_speed) {
        this.max_speed = max_speed;
    }

    public double getDistance() {
        return distance;
    }

    public void setDistance(double distance) {
        this.distance = distance;
    }

    public double getAver_speed() {
        return aver_speed;
    }

    public void setAver_speed(double aver_speed) {
        this.aver_speed = aver_speed;
    }
}
